set -ex

export MLU_VISIBLE_DEVICES=5
mlus=$(echo $MLU_VISIBLE_DEVICES | awk -F "," '{print NF}')

PORT=${PORT:-29501}
MASTER_ADDR=${MASTER_ADDR:-"127.0.0.1"}

python -m torch.distributed.launch \
	--master_addr=$MASTER_ADDR \
	--nproc_per_node=$mlus \
	--master_port=$PORT \
	example_text_completion.py \
       	--ckpt_dir /data/AE/tangchuang/llama2/Llama-2-7b/ \
       	--tokenizer_path /data/AE/tangchuang/llama2/Llama-2-7b/tokenizer.model \
	--max_seq_len 512 \
	--max_batch_size 4
